/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.pub.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.tech15.core.model.Attach;
import com.tech15.core.model.SysUser;
import com.tech15.pub.model.*;
import com.tech15.pub.dao.*;
import com.tech15.pub.service.*;
import com.tech15.pub.vo.query.*;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "MEETING")
public class Meeting extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "会议预定";
	public static final String ALIAS_ID = "序号";
	public static final String ALIAS_ZT = "主题";
	public static final String ALIAS_HYRQ = "会议日期";
	public static final String ALIAS_MRID = "会议室id";
	public static final String ALIAS_HYSJ = "会议时间段";
	public static final String ALIAS_YDR = "预定人";
	public static final String ALIAS_BZ = "备注";
	
	//date formats
	public static final String FORMAT_HYRQ = DATE_FORMAT;
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 序号       db_column: ID 
     */ 	
	
	private Long id;
    /**
     * 主题       db_column: ZT 
     */ 	
	@Length(max=200)
	private java.lang.String zt;
    /**
     * 会议日期       db_column: HYRQ 
     */ 	
	
	private java.util.Date hyrq;
    /**
     * 会议室id       db_column: MRID 
     */ 	
	
	private Long mrid;
    /**
     * 会议时间段       db_column: HYSJ 
     */ 	
	@Length(max=100)
	private java.lang.String hysj;
    /**
     * 预定人       db_column: YDR 
     */ 	
	
	private Long ydr;
    /**
     * 备注       db_column: BZ 
     */ 	
	@Length(max=400)
	private java.lang.String bz;
	/**
     * 议题1       db_column: YT1 
     */ 	
	@Length(max=400)
	private java.lang.String yt1;
    /**
     * 议题2       db_column: YT2 
     */ 	
	@Length(max=400)
	private java.lang.String yt2;
    /**
     * 议题3       db_column: YT3 
     */ 	
	@Length(max=400)
	private java.lang.String yt3;
    /**
     * 议题4       db_column: YT4 
     */ 	
	@Length(max=400)
	private java.lang.String yt4;
	//columns END


	public Meeting(){
	}

	public Meeting(
		Long id
	){
		this.id = id;
	}

	

	public void setId(Long value) {
		this.id = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "ID", unique = true, nullable = false, insertable = true, updatable = true, length = 22)
	public Long getId() {
		return this.id;
	}
	
	@Column(name = "ZT", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getZt() {
		return this.zt;
	}
	
	public void setZt(java.lang.String value) {
		this.zt = value;
	}
	
	@Transient
	public String getHyrqString() {
		return DateConvertUtils.format(getHyrq(), FORMAT_HYRQ);
	}
	public void setHyrqString(String value) {
		setHyrq(DateConvertUtils.parse(value, FORMAT_HYRQ,java.util.Date.class));
	}
	
	@Column(name = "HYRQ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getHyrq() {
		return this.hyrq;
	}
	
	public void setHyrq(java.util.Date value) {
		this.hyrq = value;
	}
	
	@Column(name = "MRID", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getMrid() {
		return this.mrid;
	}
	
	public void setMrid(Long value) {
		this.mrid = value;
	}
	
	@Column(name = "HYSJ", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
	public java.lang.String getHysj() {
		return this.hysj;
	}
	
	public void setHysj(java.lang.String value) {
		this.hysj = value;
	}
	
	@Column(name = "YDR", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getYdr() {
		return this.ydr;
	}
	
	public void setYdr(Long value) {
		this.ydr = value;
	}
	
	@Column(name = "BZ", unique = false, nullable = true, insertable = true, updatable = true, length = 400)
	public java.lang.String getBz() {
		return this.bz;
	}
	
	public void setBz(java.lang.String value) {
		this.bz = value;
	}
	
	@Column(name = "YT1", unique = false, nullable = true, insertable = true, updatable = true, length = 400)
	public java.lang.String getYt1() {
		return this.yt1;
	}
	
	public void setYt1(java.lang.String value) {
		this.yt1 = value;
	}
	
	@Column(name = "YT2", unique = false, nullable = true, insertable = true, updatable = true, length = 400)
	public java.lang.String getYt2() {
		return this.yt2;
	}
	
	public void setYt2(java.lang.String value) {
		this.yt2 = value;
	}
	
	@Column(name = "YT3", unique = false, nullable = true, insertable = true, updatable = true, length = 400)
	public java.lang.String getYt3() {
		return this.yt3;
	}
	
	public void setYt3(java.lang.String value) {
		this.yt3 = value;
	}
	
	@Column(name = "YT4", unique = false, nullable = true, insertable = true, updatable = true, length = 400)
	public java.lang.String getYt4() {
		return this.yt4;
	}
	
	public void setYt4(java.lang.String value) {
		this.yt4 = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Zt",getZt())
			.append("Hyrq",getHyrq())
			.append("Mrid",getMrid())
			.append("Hysj",getHysj())
			.append("Ydr",getYdr())
			.append("Bz",getBz())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Meeting == false) return false;
		if(this == obj) return true;
		Meeting other = (Meeting)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
	
	private String dataname;
	private String username;
	private String strtime;
	private String hyrqBegin;
	private String hyrqEnd;
	private String attendUsers;
	
	private List<MeetingUser> meetingUsers;
	private List<Attach> attach;
	
	@Transient
	public List<Attach> getAttach() {
		return attach;
	}

	public void setAttach(List<Attach> attach) {
		this.attach = attach;
	}

	@Transient
	public List<MeetingUser> getMeetingUsers() {
		return meetingUsers;
	}

	public void setMeetingUsers(List<MeetingUser> meetingUsers) {
		this.meetingUsers = meetingUsers;
	}

	@Transient
	public String getAttendUsers() {
		return attendUsers;
	}

	public void setAttendUsers(String attendUsers) {
		this.attendUsers = attendUsers;
	}

	@Transient
	public String getHyrqBegin() {
		return hyrqBegin;
	}

	public void setHyrqBegin(String hyrqBegin) {
		this.hyrqBegin = hyrqBegin;
	}

	@Transient
	public String getHyrqEnd() {
		return hyrqEnd;
	}

	public void setHyrqEnd(String hyrqEnd) {
		this.hyrqEnd = hyrqEnd;
	}

	@Transient
	public String getStrtime() {
		return strtime;
	}

	public void setStrtime(String strtime) {
		this.strtime = strtime;
	}

	@Transient
	public String getDataname() {
		return dataname;
	}

	public void setDataname(String dataname) {
		this.dataname = dataname;
	}

	@Transient
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}
}

